<template>
  <view>
    <p-navbar :title="this.types?'币圈热点':'新手指南'"></p-navbar>
	<!-- 标题 -->
    <view class="title">{{ list.title || list.headLine }}</view>
	<!-- 时间 -->
    <view class="main">{{this.types?list.updateTime : list.createDt }}</view>
    <view class="fooler">
	<!-- 内容 -->
	 <u-parse :html="description" :tag-style="style"></u-parse>
	 <!-- 新手指南 -->
	 <image v-if="list.image" :src="list.image" mode="widthFix" @tap="previe(list.image)"/>
	  <view class="mian" >
	  	免责声明： 诸葛量化作为开放的信息发布平台，所提供的所有资讯与诸葛量化观点和立场无关，且不构成任何投资理财建议。望用户仔细甄别，防范风险。
	  </view>
    </view>
    
  </view>
</template>

<script>
export default {
  computed: {
    html2text() {
      return (t) => t.replace(/\s*/g, "").replace(/<[^>]*>/g, "");
    },
    num() {
      return (t) => {
        if (!t) return "0.0000";
        return Number(t).toFixed(4);
      };
    },
	option(){
		return this.$state.user
	},
  },
  data() {
    return {
		list: {},
		wid:'615',
		indent:true,
		description:'',
		zanimg:false,
		style:{
			video:'width:100%;text-align: center;color:#000'
		},
		types:'',
    };
  },
  onLoad(options) {
	  this.types = options.types
	  this.wid = options.id
	  if(this.types){//明星量化
		  this.request.post('getInformationDetailsById?id='+this.wid, {
		  }).then(res=>{
			  this.list = res.data.data
			  this.description = JSON.parse(this.list.content).content
		  })
	  }else{//新手指南
		  this.list = JSON.parse(this.$Route.query.type);
		  this.description = this.list.detail
		  this.request.post('guideMessage/detail?id='+this.list.id)//获取浏览数
	  }
  },
  methods:{
	  previe(e){
	  	uni.previewImage({
	  		current:1, //预览图片的下标
	  		urls:[e] //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
	    })
	  },
  	zan(){
  		this.request.post('Notice/GuideFabulous', {
  				uid:this.encrypt(this.option.id),
  				id_1: this.encrypt(this.list.id),
  				type:'0'
  			})
  			.then(res => {
				this.zanimg = true
  			})
  	}  
  },
};
</script>

<style lang="scss">
page {
  margin: 20rpx 10rpx 20rpx 40rpx;
  width: 90%;
  padding: 0 0rpx 40rpx;
}
.title {
  font-size: 30rpx;
  font-weight: bold;
  line-height: 70rpx;
  // color: #fff;
  text-align: center;
}
.main {
  font-size: 25rpx;
  color: #000000;
  font-weight: bold;
  line-height: 70rpx;
  text-align: center;
  border-bottom: 1px solid #2e3252;
  margin-bottom: 20rpx;
}
.fooler {
  font-size: 25rpx;
  
  // color: #fff;
  // font-weight: bold;
  line-height: 40rpx;
  image{
	  // width: 100%;
	  // display: block;
	  // height: 800rpx;
  }
	.zan{
		margin-left: auto;
		width: 100rpx;
		.zan-img{
			width: 24rpx;
			height: 24rpx;
			margin-left: 10rpx;
		}
	}
	
}
.text {
  color: #999;
  margin-top: 20rpx;
}
.line {
  line-height: 50rpx;
  color: #000;
}
.mian{
	margin-top: 20rpx;
	border: 1px solid $light-color;
	padding: 20rpx;
	
}
</style>
